Skip to content

Comments

Add weekly background Kyoto CBF sync task (#352)#354

Open
Aniket-pd wants to merge 1 commit intobitcoindevkit:mainfrom
Aniket-pd:352-background-cbf-sync
Open

Add weekly background Kyoto CBF sync task (#352)#354
Aniket-pd wants to merge 1 commit intobitcoindevkit:mainfrom
Aniket-pd:352-background-cbf-sync

Conversation

@Aniket-pd
Copy link

Description

This PR implements the background CBF sync flow discussed in #352.

In short, the app now registers a BGProcessingTask and schedules it to run roughly once a week (with network + external power requirements). When the task runs, it attempts to load the wallet and perform a Kyoto sync if the wallet exists and Kyoto is the selected backend.

I also added the required Info.plist entries for background processing and updated keychain accessibility to .afterFirstUnlock so background execution can still read wallet backup data while the device is locked.

Notes to the reviewers

I kept this intentionally narrow to the core pieces needed for background sync:

  • task registration/scheduling,
  • task execution path,
  • plist configuration,
  • keychain accessibility prerequisite.

I did not add product-level logging in this PR, since #351 tracks that separately.

Changelog notice

Add weekly background Kyoto CBF sync using BGProcessingTask, including required background task configuration and keychain access changes needed for locked-device execution.

Checklists

All Submissions:

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature
  • UI changes tested on small, medium, and large devices to ensure layout consistency

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

@r1b2ns
Copy link
Collaborator

r1b2ns commented Feb 20, 2026

Hi @Aniket-pd, I’m trying to review this PR but I’m running into a crash during kyoto sync. Have you ever seen this issue?

`[Kyoto] Preparing CBF components – network: signet, dataDir: /Users/rubensmachion/Library/Developer/CoreSimulator/Devices/5D32E5C5-1662-4F90-966F-55371A6EAF07/data/Containers/Data/Application/648B220A-17C8-4CA5-9431-5539C1598899/Documents/wallet_data/kyoto, peers: 2, scanType: recovery(usedScriptIndex: 1000, checkpoint: BitcoinDevKit.RecoveryPoint.taprootActivation)

thread '' panicked at /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bdk_kyoto-0.15.3/src/lib.rs:160:43:
there is no reactor running, must be called from the context of a Tokio 1.x runtime
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
CoreSimulator 1051.9.4 - Device: iPhone 17 (5D32E5C5-1662-4F90-966F-55371A6EAF07) - Runtime: iOS 26.1 (23B86) - DeviceType: iPhone 17

Can't show file for stack frame : <DBGLLDBStackFrame: 0x93f04e800> - stackNumber:3 - name:panic_abort::__rust_start_panic::abort::h158a95d7d8b6f370. The file path does not exist on the file system: /rustc/4eb161250e340c8f48f66e2b929ef4a5bed7c181/library/panic_abort/src/lib.rs`

@reez
Copy link
Collaborator

reez commented Feb 20, 2026

just fyi, android saw a crash (I dont know where crash logs are so im not able to compare to know if this is same crash as that) on kyoto in bdk-ffi 2.3.0, so there will be an upcoming 2.3.1 patch release with kyoto patch bitcoindevkit/bdk-ffi#953

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants